﻿using OnlineTestsModels;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Linq.Expressions;
using System.Web;

namespace OnlineTestsRest.Models.TestModels
{
    public class TestShortModel
    {
        public static Expression<Func<Test, TestShortModel>>  FromTest
        {
            get
            {
                return t => new TestShortModel()
                {
                    Id = t.Id,
                    Name = t.Name,
                    Duration = t.DurationMinutes,
                    StartDate = t.StartDate,
                    EndDate = t.EndDate,
                };
            }
        }

        public int Id { get; set; }

        public string Name { get; set; }

        public int Duration { get; set; }

        public DateTime StartDate { get; set; }

        public DateTime EndDate { get; set; }
    }
}